package com.yanqu.road.entity.servercenter;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_u_xserver_name")
public class XServerName extends DataObject {

    @FieldTypeAnnotation(desc = "渠道ID", select = true, update = true)
    private int channelId;
    @FieldTypeAnnotation(desc = "区服ID", select = true, update = true)
    private long serverId;
    @FieldTypeAnnotation(desc = "名称")
    private String name;

    public XServerName(int channelId, long serverId, String name) {
        this.channelId = channelId;
        this.serverId = serverId;
        this.name = name;
    }

    public void setName(String name) {
        if (name == null) {
            return;
        }
        if (!Objects.equals(name, this.name)) {
            this.name = name;
            setUpdateOption();
        }
    }

    public int getChannelId() {
        return channelId;
    }

    public long getServerId() {
        return serverId;
    }

    public String getName() {
        return name;
    }
}
